<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core">

    <h:head>
        <title>Login</title>
        <h:outputStylesheet library="css" name="style.css" />
    </h:head>

    <h:body>
        <f:view locale="#{languageBean.currentLocale}">
            <h:outputText value="#{msg.webshop_login}" styleClass="h1" />
            <h:messages styleClass="h2" />
            <h:form>
                <h:panelGrid columns="2">
                    <h:commandLink action="#{languageBean.changeLocale('de_DE')}">
                        <h:graphicImage library="img" name="german.jpg" />
                    </h:commandLink>
                    <h:commandLink action="#{languageBean.changeLocale('en')}">
                        <h:graphicImage library="img" name="english.jpg" />
                    </h:commandLink>
                </h:panelGrid>
            </h:form>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputText value="#{msg.webshop_login_username}" styleClass="h3" />
                    <h:inputText id="username" label="username" value="#{loginBean.username}" required="true" requiredMessage="#{msg.webshop_login_username_required}" />
                    <h:outputText value="#{msg.webshop_login_password}" styleClass="h3" />
                    <h:inputSecret id="password" label="password" value="#{loginBean.password}" required="true" requiredMessage="#{msg.webshop_login_password_required}" />
                </h:panelGrid>
                <h:selectOneMenu value="#{sessionBean.country}">
                    <f:selectItem itemValue="AUT" itemLabel="#{msg.webshop_AT}" />
                    <f:selectItem itemValue="GER" itemLabel="#{msg.webshop_DE}" />
                    <f:selectItem itemValue="CHE" itemLabel="#{msg.webshop_CH}" />
                </h:selectOneMenu>
                <h:commandButton action="#{loginBean.login}" value="#{msg.webshop_action_login}" />
            </h:form>
        </f:view>
    </h:body>
</html>

